package com.ruoyi.employee.service.impl;

import com.ruoyi.employee.domain.EmployeeGift;
import com.ruoyi.employee.mapper.EmployeeGiftMapper;
import com.ruoyi.employee.service.IEmployeeGiftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 评价订单 业务层处理
 * 
 * @author ruoyi
 */
@Service
public class EmployeeGiftServiceImpl implements IEmployeeGiftService
{

    @Autowired
    private EmployeeGiftMapper employeeGiftMapper;

    /**
     * 根据条件分页查询关联列表
     *
     * @param employeeGift 关联信息
     * @return 关联信息集合信息
     */
    @Override
    public List<EmployeeGift> selectEmployeeGiftList(EmployeeGift employeeGift)
    {
        return employeeGiftMapper.selectEmployeeGiftList(employeeGift);
    }


    /**
     * 根据条件分页查询关联列表
     *
     * @param employeeGift 关联信息
     * @return 关联信息集合信息
     */
    @Override
    public EmployeeGift selectEmployeeGiftInfo(EmployeeGift employeeGift)
    {
        return employeeGiftMapper.selectEmployeeGiftInfo(employeeGift);
    }

    /**
     * 新增保存店员关联礼物信息
     *
     * @param employeeGift 店员关联礼物信息
     * @return 结果
     */
    @Override
    @Transactional
    public int insertEmployeeGift(EmployeeGift employeeGift)
    {
        // 新增店员信息
        int rows = employeeGiftMapper.insertEmployeeGift(employeeGift);
        return rows;
    }

    /**
     * 修改保存店员关联礼物信息
     *
     * @param employeeGift 店员关联礼物信息
     * @return 结果
     */
    @Override
    @Transactional
    public int updateEmployeeGift(EmployeeGift employeeGift)
    {
        return employeeGiftMapper.updateEmployeeGift(employeeGift);
    }


    /**
     * 批量删除店员关联礼物信息
     *
     * @param ids 需要删除的店员关联礼物ID
     * @return 结果
     */
    @Override
    @Transactional
    public int deleteEmployeeGiftByIds(Long[] ids)
    {
        return employeeGiftMapper.deleteEmployeeGiftByIds(ids);
    }
}
